Getting started
The I2C RTOS application is designed to work on one single board or two different boards(BM version only support two boards).
Build with different RTOS support
Before running this application, you should build it with the correct RTOS you want to run. For IAR, the projects to support different RTOS is distinguished by the workspace file name: i2c_rtos_<rtos>.eww, e.g. i2c_rtos_ucosii.eww is uC/OS-II version of this application. Open the right workspace, first build the platform_<rtos>_lib project, then build the application project. The binary i2c_rtos_<rtos>.out will be generated.
Hardware Connections for I2C bus
FRDM-K64F120M
| Master | Slave |
| I2C0_SCL PTE24 (Pin 18 on J2) | I2C1_SCL PTC10 (Pin 10 on J26) |
| I2C0_SDA PTE25 (Pin 20 on J2) | I2C1_SDA PTC11 (Pin 12 on J26) |
| Master (board #1) | Slave (board #2) |
| I2C0_SCL PTE24 (Pin 18 on J2) | I2C1_SCL PTC10 (Pin 10 on J26) |
| I2C0_SDA PTE25 (Pin 20 on J2) | I2C1_SDA PTC11 (Pin 12 on J26) |
| GND (Pin 14 on J2) | GND (Pin 14 on J2) |
TWR-K64F120M
| Master | Slave |
| I2C0_SCL PTD8 (Pin A7 on J11A) | I2C1_SCL PTC10 (Pin A75 on J11A) |
| I2C0_SDA PTD9 (Pin A8 on J11A) | I2C1_SDA PTC11 (Pin B71 on J11A) |
| Master (board #1) | Slave (board #2) |
| I2C0_SCL PTD8 (Pin A7 on J11A) | I2C1_SCL PTC10 (Pin A75 on J11A) |
| I2C0_SDA PTD9 (Pin A8 on J11A) | I2C1_SDA PTC11 (Pin B71 on J11A) |
| GND (Pin A65 on J11A) | GND (Pin A65 on J11A) |
Run the application
- Connect I2C Clock, Data and GND signal as described above.
- Power on the board (boards), download the application into flash and run.
- Open the PC console to connect to the Master board.
- When successfully connected, you can input help to get the supported command list:
Available Commands:
help - print command description/usage
led (1)- Light on/off the RGB LED
readtemp(2)- Get the temperature of the client
readid (3)- Read the client unique id
LED Command
- Light the LED on/off on the slave board.
- Usage: led R/G/B on/off
- Example: Turn the RED LED on
Temperature Get Command
- Get the chip temperature on the slave board.
- Usage: readtemp
- Example:
>>readtemp
Client Chip Temperature:37C
Read chip UID Command
- Get the slave chip UID
- Usage: readid
- Example:
>>readid
Client ID:0x10013